using System.Linq;
using Xtensive.Orm;

namespace SalesPoint.Model
{
  [KeyGenerator(KeyGeneratorKind.None)]
  [TableMapping("Customers")]
  [HierarchyRoot]
  public class Customer : BusinessContact
  {
    [Field(Length = 5), FieldMapping("CustomerId"), Key]
    public string Id { get; private set; }

    [Field, Association(PairTo = "Customer")]
    public EntitySet<Order> Orders { get; private set; }

    // Constructors

    public Customer(Session session, string id)
      : base(session, id)
    {
    }
  }
}